//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet.Extensibility
{
    public class AllowToStringConversionAttribute : ParameterConverterAttribute
    {
        internal override void ConvertImp(ConversionData data)
        {
            if (data.TargetType == typeof(string))
            {
                object value = data.Value;
                if (value is ICell)
                    value = ((ICell) value).Value;
                if (value != null)
                    data.Result = value.ToString();
            }
        }
    }
}